package com.example.app.pages.main.home.addNew.addRecord

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import com.example.app.components.MyImage.MyAsyncSvgImage
import com.example.app.components.MySpacer.MySpacer
import com.example.app.components.MyText.MyText
import com.example.app.data.bean.AccountTitle
import com.example.app.ui.theme.my_description_color

@Composable
fun IncomeTitle(accountTitle:AccountTitle){
    Box(
        modifier = Modifier.fillMaxWidth(1f / 4f),
        contentAlignment = Alignment.Center
    ) {
        Column(
            modifier = Modifier.fillMaxWidth(),
            verticalArrangement = Arrangement.Center,
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            Box(
                contentAlignment = Alignment.Center,
                modifier = Modifier
                    .clip(CircleShape)
                    .background(MaterialTheme.colorScheme.background)
                    .padding(10.dp)
            ) {
                MyAsyncSvgImage(
                    path = accountTitle.IconPath,
                    modifier = Modifier.size(26.dp)
                )
            }
            MySpacer(modifier = Modifier.height(6.dp))
            MyText(
                text = accountTitle.TitleName!!,
                style = MaterialTheme.typography.bodySmall.copy(color = my_description_color)
            )
            MySpacer(modifier = Modifier.height(24.dp))
        }
    }
}